#ifndef CITYFLOW_MULTIPROCESSOR_H
#define CITYFLOW_MULTIPROCESSOR_H

#include "flow/flow.h"
#include "roadnet/roadnet.h"
#include "engine/archive.h"
#include "engine/engine.h"
#include "utility/barrier.h"

#include <mutex>
#include <thread>
#include <set>
#include <fstream>
#include <string>

namespace CityFlow {
    class multiprocessor{
        friend class Engine;
        friend class RoadNet;

        private:
        RoadNet roadnet;
        std::vector<Engine *> engines;
        int step = 0;
        int syncRate = 50;

        public:
        multiprocessor(const std::string &configFile);
        bool loadFromConfig(std::string);
        void nextStepPro_F();
        void engineNext(int);
        void calDensity(int, int);
        std::vector<Engine*> getEngines() { return engines; }
    };
};

#endif